<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
  
    
</style>

<body>
       <div style="float: left;width: 50px;height: 50px;background: red;">11</div>
       <div style="width: 300px;height: 300px;background: pink;overflow: hidden;">222288888888888888888</div>
</body>
<script>
//    1.margin塌陷

//    2.清除浮动流
var a = {}
// console.log(a)
// console.log(a.__proto__.__proto__)
// 每一个对象都有一个__proto__属性
console.log(Object.prototype)

function deepClone(obj) {
    var res = null
    if(Object.prototype.toString.call(obj) === 'object Array') {
        res = []
    } else {
        res = {}
    }
    for(var i in obj) {
        if(typeof obj[i] === 'object') {
            res[i] = deepClone(obj[i])
        } else {
            res[i] = obj[i]
        }
    }
    return res
}

var obj = {
    name: 'name',
    info:{
        tel: '110'
    },
    arr: [1, 2, 3]
}

var res = deepClone(obj)
// obj.info.tel = '220'
obj.arr[0] = 100
console.log(obj)
console.log(res)


</script> 

</html>